/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 查询认证申请分页列表 GET /application */
export async function applicationGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.ApplicationGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelApplicationModel_>(
    '/application',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 编辑认证申请 PUT /application */
export async function applicationUpdate({
  body,
  options,
}: {
  body: API.UpdateApplicationModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/application', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增认证申请 POST /application */
export async function applicationInsert({
  body,
  options,
}: {
  body: API.InsertApplicationModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/application', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 受理 PUT /application/accept */
export async function applicationAccept({
  body,
  options,
}: {
  body: API.UpdateApplicationModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/application/accept', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询认证申请详情 GET /application/detail */
export async function applicationGet2({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.ApplicationGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelApplicationModel_>('/application/detail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
